home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 1999 February / Macworld (1999-02).dmg / Shareware World / Comms & Internet / PPPop2.0.1-PPC / PPPop Scripts / Script Samples / AutoCheck StayOpen next >
Text File  |  1998-10-17  |  603b  |  30 lines

  1.  
  2. property idletime : 10 * 60 -- number of seconds between runs
  3. property opentime : 2 * 60 -- seconds to await link open
  4. property mailtime : 5 * 60 -- seconds for mail check
  5.  
  6. on idle
  7.     try
  8.         tell application "PPPop2"
  9.             connect
  10.             with timeout of opentime seconds
  11.                 repeat until (PPP up)
  12.                 end repeat
  13.             end timeout -- will go to error if not open
  14.         end tell
  15.         
  16.         with timeout of mailtime seconds
  17.             tell application "Eudora Pro 4.0" to connect with sending and checking
  18.             activate
  19.         end timeout
  20.         
  21.         tell application "PPPop2" to disconnect
  22.         
  23.     on error
  24.         beep
  25.     end try
  26.     
  27.     return idletime
  28.     
  29. end idle
  30.